package org.hawk.gwt.ppc.parser;

import java.util.List;

/**
 * Encapsulates results of parsing single class.
 * Provides information about internal class methods, fields,
 * classes and initializing blocks.
 * 
 * @author alex.bereznevatiy@gmail.com
 *
 */
public interface ClassDescriptor extends DescriptorContainer, ModificatedDescriptor {
	
	/**
	 * 
	 * @author alex.bereznevatiy@gmail.com
	 *
	 */
	public enum ClassDescriptorType {
		CLASS,
		ENUM,
		INTERFACE,
		ANNOTATION
	}
	
	/**
	 * @return name of the class this descriptor represents.
	 */
	String getName();
	
	/** 
	 * @return keyword representing this type.
	 * One of:
	 * class - for regular classes
	 * interface - for interfaces
	 * enum - for enum types
	 * @interface - for annotations.
	 */
	ClassDescriptorType getType();
	
	/**
	 * @return type parameters section of this class if any.
	 */
	String getTypeParameters();
	
	/**
	 * @return list of classes from extends section.
	 * Since this interface may represent as java lass as interface
	 * there may be several types in this section. Also anonymous classes 
	 * hold the type to be extended in this section. 
	 */
	List<String> getExtendsSection();
	
	/**
	 * @return List of explicitly implemented interfaces from 
	 * implements section.
	 */
	List<String> getImplementsSection();
	
	/**
	 * @return list of methods in the order they are declared in the 
	 * class body.
	 */
	List<MethodDescriptor> getMethods();
	
	/**
	 * @return list of initializers in order they are defined in the 
	 * class body.
	 */
	List<BlockDescriptor> getInitializers();
	
	/**
	 * @return list of explicitly defined constructors in order they
	 * appear in class body.
	 */
	List<ConstructorDescriptor> getConstructors();
	
	/**
	 * @return list of member classes in order they are defined in
	 * the class body.
	 */
	List<ClassDescriptor> getDeclaredClasses();
	
	/**
	 * @return list of variables in order they are declared in 
	 * the class body.
	 */
	List<FieldDescriptor> getFields();
}
